<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./lib/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="button" value="ChangeMsg" @click="msg='数据被修改了'">
        <h3 id="myh3">{{msg}}</h3>

    </div>
    <script>
        Vue.config.devtools = true
        var vm=new Vue({
            el: "#app",
            data:{
                msg:"123"

            },
            methods:{
                show(){
                    console.log("show方法被调用了")
                }
            },
            beforeCreate(){
                //console.log(this.msg)
            },//第一个生命周期函数
            created(){//第二个生命周期函数
                console.log(this.msg)
                this.show()

            },
            beforeMount(){//创建阶段的第三个周期函数，表示即将挂载


            },
            mounted(){//创建阶段的第四个周期函数，表示页面已经完成渲染，标志创建阶段结束，即将进入运行阶段

            },
            beforeUpdate(){
               /* const ele =document.getElementById("myh3")
                console.log(ele.innerHTML) */
            },
            updated(){
                const ele=documentgetById("myh3")
                console.log(ele.innerHTML)
            }
        });

        





    </script>
    
</body>
</html>